import BaseModel from './.model';
import { Table, Column, DataType, ForeignKey } from 'sequelize-typescript';
import UserModel from './user.model';
import RoleModel from './role.model';

@Table({ tableName: 'user_roles' })
export default class UserRoleModel extends BaseModel {
  /** 用户ID */
  @ForeignKey(() => UserModel)
  @Column({ type: DataType.UUID, comment: '用户ID' })
  userId!: string;

  /** 角色ID */
  @ForeignKey(() => RoleModel)
  @Column({ type: DataType.UUID, comment: '角色ID' })
  roleId!: string;
}